package cn.com.yiqi.wsc.service.customer;

import cn.com.yiqi.wsc.Ro.AddressVO;
import cn.com.yiqi.wsc.Ro.CustomerRo;
import cn.com.yiqi.wsc.Ro.SpreadVO;
import cn.com.yiqi.wsc.common.Result;
import cn.com.yiqi.wsc.entity.customer.Customer;
import cn.com.yiqi.wsc.entity.customer.CustomerMention;
import cn.com.yiqi.wsc.entity.order.OrderMain;
import cn.com.yiqi.wsc.entity.order.OrderPay;
import cn.com.yiqi.wsc.entity.shop.Item;
import cn.com.yiqi.wsc.ro.WeixinInfoRO;
import com.github.pagehelper.PageInfo;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * Created by 林威 on 2017/2/17.
 */
public interface CustomerService {
    CustomerRo updateOrInsertUser(WeixinInfoRO weixinInfoRO,Integer pid);

    Result<Customer> isExist(Integer userId);

    void like(Integer userId, Integer itemId);

    Integer deletelike(Integer userId, Integer itemId);

    boolean isDelete(String openid);

    Customer selectById(Integer userId);

    List<AddressVO> findAllAddress(Integer userId);

    Result<Customer> sendCode(String mobile, Integer userId);

    Result<Customer> bingMobile(String mobile, Integer userId, String code);

    AddressVO findaddressByid(Integer addressId);

    void setDefaultAddress(Integer id);

    void updateAddress(AddressVO vo);

    void insertAddress(AddressVO vo);

    void deleteAddress(Integer id);

    Result<Customer> isExistUserAndAddress(Integer userId, Integer addressId);

    void updateCustomer(Customer customer);

    /**
     * 是否能够兑换积分
     * */
    Result canExchange(Integer userId, Integer exchangePoint);

    /**
     * 是否可以额外申请兑换
     * */
    Result canExtraExchange(Integer userId,Integer extraPoint);

    Result<Customer> findCustomerAndHigherCustomer(Integer userId);

    /**
     * 购买vip商品增加时长
     * */
    void addVipTime(Integer userId, Item item);

    /**
     * 生日提醒
     * */
    List<CustomerMention> findAllBirthMention(Integer userId,Integer id);

    /**
     * 保存或新增提醒
     * */
    Result insertOrUpdateMention(CustomerMention mention);

    /**
     * 删除关系
     * */
    void deleteMention(Integer id, Integer userId);

    /**
     * 成为下级分销
     * */
    void beNextLevel(Integer fUserId,Integer sonId);

    PageInfo<SpreadVO> findSpread(Integer userId,Integer pagesize,Integer currentPage);

    void spread(OrderMain order);

    /**
     * 分享获得了金额
     * */
    BigDecimal sumSpreadBalance(Integer userId);

    /**
     * 分享获得积分
     * */
    BigDecimal sumSpreadPoint(Integer userId);

    /**
     * 下线
     * */
    PageInfo<Customer> findRecomend(Integer userId, int i, int i1);
}
